package com.numbfish.ch02_ex05_aop_annotation.aspects;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class HumanAspect {
    @Before("@within(com.numbfish.ch02_ex05_aop_annotation.config.A1)")
    public void execute1(){
        System.out.println("@within --- A1");
    }

//    @Before("@target(com.numbfish.ch02_ex05_aop_annotation.config.A1)")
//    public void execute2(){
//        System.out.println("@target --- A1");
//    }

    @Before("@within(com.numbfish.ch02_ex05_aop_annotation.config.A2)")
    public void execute3(){
        System.out.println("@within --- A2");
    }

//    @Before("@target(com.numbfish.ch02_ex05_aop_annotation.config.A2)")
    public void execute4(){
        System.out.println("@target --- A2");
    }
}
